<template>
  <div class="page">
	<div class="layui-fluid">
			<div class="layui-row layui-col-space15">
				<div class="layui-col-md12">
					<div class="layui-card">

						<div class="layui-card-body">
							<table class="layui-table" lay-even="" lay-skin="nob">
								  <colgroup>
								    <col>
								    <col>
								    <col>
								    <col>
								    <col>
								    <col>
								  </colgroup>
								  <thead>
								    <tr class="busines_title">
								      <th>银行卡号</th>
								      <th>卡类型</th>
								      <th>支行名称</th>
								      <th>真实姓名</th>
								      <th>操作</th>
								    </tr>
								  </thead>
								  <tbody >
								    <tr class="busines_content" v-for="item in bankarr">
								      <td>{{item.account}}</td>
								      <td>{{item.bankType.name}}</td>
								      <td>{{item.branch}}</td>
								      <td>{{item.realname}}</td>
								      <td>
								      	 <a class="layui-btn layui-btn-xs layui-btn-normal" @click='choose(item.id)'>选取</a>
								      </td>
								    </tr>
								  </tbody>								
								</table>  
							
						</div>
					</div>
				</div>
			</div>
		</div>
  </div>
</template>
<script>
export default {	
  name: 'operatoradd',  
  data () {
    return { 
    	id:'',
    	bankId:'',
    	bankarr:[]
  	}
  },
  mounted(){ 
  	var _this = this;   	
	  window.getdates = this.getdates;
	  this.getbank()
  },
  methods: {  	
		getdates:function(dates){
  		this.id=dates.id
  	},
		getbank:function(){
			var url='/pay/papi/v1.9/bank/find/accountId'
			var _this=this;
			ajaxRequest(url, 'GET', 'json','', function(ret, err){
		  	_this.bankarr=ret.data;
		  })
		},
		choose:function(bankid){
			var url='/pay/bapi/v1.9/settlement/updateApplyBank'
			var dates={
				bankId:bankid,
				id:this.id,
			}
			ajaxRequest(url, 'PUT', 'json',dates, function(ret, err){
			  layer.msg("操作成功");
			  setTimeout(function(){
			  	var index = parent.layer.getFrameIndex(window.name);
			    parent.layer.close(index);
		      parent.location.reload();
	      },1000)
			})
		}
  },
  updated:function(){

  },

}
</script>
<style scoped>
	.red{color:#ff0000;}
	.layuitj{float:left;line-height:38px;color:#FF0000;}
	.layuitj1{margin-left:20px;}
</style>
